import config from "@/config"
import http from "@/utils/request"

export default {
	menu: {
		GetAllMenuList: {
			url: `${config.API_URL}/api.v1/auth/AuthMenu.Get`,
			name: "获取所有菜单",
			get: async function () {
				return await http.get(this.url);
			}
		},
		UpdateMenu: {
			url: `${config.API_URL}/api.v1/auth/AuthMenu.Update`,
			name: "更新指定菜单",
			post: async function (data = {}) {
				return await http.post(this.url, data);
			}
		},
		AddMenu: {
			url: `${config.API_URL}/api.v1/auth/AuthMenu.Add`,
			name: "添加新菜单",
			post: async function (data = {}) {
				return await http.post(this.url, data);
			}
		}
	},
	OperationLog: {
		GetAllOperationLogList: {
			url: `${config.API_URL}/api.v1/auth/OperationLog.Get`,
			name: "获取所有操作日志",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
	},
	Role: {
		GetAllRole: {
			url: `${config.API_URL}/api.v1/auth/Role.Get`,
			name: "获取所有角色",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		AddRole: {
			url: `${config.API_URL}/api.v1/auth/Role.Add`,
			name: "新增角色",
			post: async function (data = {}) {
				return await http.post(this.url, data);
			}
		},
		GetRolePermission: {
			url: `${config.API_URL}/api.v1/auth/Role.Permission`,
			name: "获取角色拥有API",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		UpdateRolePermission: {
			url: `${config.API_URL}/api.v1/auth/Role.Permission`,
			name: "获取角色拥有API",
			post: async function (data = {}) {
				return await http.post(this.url, data);
			}
		},
	},
	User: {
		GetAllUserList: {
			url: `${config.API_URL}/api.v1/auth/User.Get`,
			name: "获取用户列表",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		ResetPasswd: {
			url: `${config.API_URL}/api.v1/auth/User.ResetPasswd`,
			name: "重置用户密码",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		GetUserMenu:{
			url: `${config.API_URL}/api.v1/auth/UserMane.Get`,
			name: "获取用户菜单",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		}
	},
	Apis: {
		SyncToCache: {
			url: `${config.API_URL}/api.v1/auth/Apis.SyncToCache`,
			name: "从内存同步API到数据库",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		GetAllApisList: {
			url: `${config.API_URL}/api.v1/auth/Apis.Get`,
			name: "获取所有API接口",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		AddApis: {
			url: `${config.API_URL}/api.v1/auth/Apis.Add`,
			name: "新增API接口",
			post: async function (data = {}) {
				return await http.post(this.url, data);
			}
		},
	},
	TaskLog: {
		getTaskLogByID: {
			url: `${config.API_URL}/api.v1/auth/findSysTaskLog.Get`,
			name: "根据ID获取定时任务日志",
			get: async function (data = {}) {
				return await http.get(this.url, data);
			}
		},
	},
	Tasks: {
		createSysTask: {
			url: `${config.API_URL}/api.v1/auth/createSysTask.Add`,
			name: "创建定时任务",
			post: async function (data = {}) {
				return await http.post(this.url, data);
			}
		},
		deleteSysTask: {
			url: `${config.API_URL}/sysTask/sysTask/deleteSysTask`,
			name: "删除定时任务",
			delete: async function (data = {}) {
				return await http.delete(this.url, data);
			}
		},
		deleteSysTaskByIds: {
			url: `${config.API_URL}/sysTask/sysTask/deleteSysTaskByIds`,
			name: "批量删除定时任务",
			delete: async function (data = {}) {
				return await http.delete(this.url, data);
			}
		},
		updateSysTask: {
			url: `${config.API_URL}/sysTask/sysTask/updateSysTask`,
			name: "修改定时任务",
			post: async function (data = {}) {
				return await http.post(this.url, data);
			}
		},
		findSysTask: {
			url: `${config.API_URL}/sysTask/sysTask/findSysTask`,
			name: "根据ID查询定时任务",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		getSysTaskList: {
			url: `${config.API_URL}/api.v1/auth/getSysTaskList.Get`,
			name: "获取所有定时任务",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		runOneSysTask: {
			url: `${config.API_URL}/api.v1/auth/runOneSysTask.Get`,
			name: "运行一次定时任务",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		enableSysTask: {
			url: `${config.API_URL}/sysTask/sysTask/enableSysTask`,
			name: "激活定时任务",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		disableSysTask: {
			url: `${config.API_URL}/sysTask/sysTask/disableSysTask`,
			name: "暂停定时任务",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		},
		removeSysTask: {
			url: `${config.API_URL}/sysTask/sysTask/removeSysTask`,
			name: "删除定时任务",
			get: async function (params) {
				return await http.get(this.url, params);
			}
		}
	},
	dic: {
		tree: {
			url: `${config.API_URL}/system/dic/tree`,
			name: "获取字典树",
			get: async function(){
				return await http.get(this.url);
			}
		},
		list: {
			url: `${config.API_URL}/system/dic/list`,
			name: "字典明细",
			get: async function(params){
				return await http.get(this.url, params);
			}
		},
		get: {
			url: `${config.API_URL}/system/dic/get`,
			name: "获取字典数据",
			get: async function(params){
				return await http.get(this.url, params);
			}
		}
	},
}
